var Util = function() {
 
    return {
        randomInt : function(min, max){
            return Math.floor(Math.random() * (max - min + 1) + min);
        },
        generateUniqueId : function() {
          var id = this.randomInt(1000000, 9999999);
          if ($("#" + id).length > 0) {
              id = this.randomInt(1000000, 9999999);
          }
          return id;
        },
        getPopupContentHTMLMap : function () {
            
            var popupContentHTML = '<div class="row">';
            popupContentHTML +='<label class="control-label col-md-12"><h5><strong>'+ 'asdsa dfsdfdsf fsdfsd fdsf name' +'</strong>';
            popupContentHTML +='<span class="glyphicon glyphicon-remove pull-right close-icon-popup-map closePopupMap"  style="position: relative;right: -8px;top: -21px;"></span>';
            popupContentHTML +='</h5></label></div>';
            
            popupContentHTML += '<div class="row">';
            popupContentHTML +='<label class="control-label col-md-6">Luu Luong Hoi:</label>';
            popupContentHTML +='<div class="col-md-3" style="padding-left: 0px;padding-right: 0px;">';
            popupContentHTML +='<p style="text-align: right;">123</p>';
            popupContentHTML +='</div>';
            popupContentHTML +='<div class="col-md-1">';
            popupContentHTML +='<p >ton/hr</p>';
            popupContentHTML +='</div>';
            popupContentHTML +='</div>';
            
            popupContentHTML += '<div class="row">';
            popupContentHTML +='<label class="control-label col-md-6">Tong Hoi Cap Trong Ngay:</label>';
            popupContentHTML +='<div class="col-md-3" style="padding-left: 0px;padding-right: 0px;">';
            popupContentHTML +='<p style="text-align: right;">34.543589</p>';
            popupContentHTML +='</div>';
            popupContentHTML +='<div class="col-md-1">';
            popupContentHTML +='<p >ton</p>';
            popupContentHTML +='</div>';
            popupContentHTML +='</div>';
            
            popupContentHTML += '<div class="row">';
            popupContentHTML +='<label class="control-label col-md-6">Ap Suat Hoi:</label>';
            popupContentHTML +='<div class="col-md-3" style="padding-left: 0px;padding-right: 0px;">';
            popupContentHTML +='<p style="text-align: right;">3.45345678</p>';
            popupContentHTML +='</div>';
            popupContentHTML +='<div class="col-md-1">';
            popupContentHTML +='<p >Kg/cm²</p>';
            popupContentHTML +='</div>';
            popupContentHTML +='</div>';
            
            popupContentHTML += '<div class="row">';
            popupContentHTML +='<label class="control-label col-md-6">Nhiet Do Hoi:</label>';
            popupContentHTML +='<div class="col-md-3"style="padding-left: 0px;padding-right: 0px;">';
            popupContentHTML +='<p style="text-align: right;">345.678345</p>';
            popupContentHTML +='</div>';
            popupContentHTML +='<div class="col-md-1">';
            popupContentHTML +='<p >°C</p>';
            popupContentHTML +='</div>';
            popupContentHTML +='</div>';
            
            popupContentHTML += '<div class="row">';
            popupContentHTML +='<label class="control-label col-md-6">Alarm counts:</label>';
            popupContentHTML +='<div class="col-md-3" style="padding-left: 0px;padding-right: 0px;">';
            popupContentHTML +='<p style="text-align: right;">34</p>';
            popupContentHTML +='</div>';
            popupContentHTML +='</div>';
            return popupContentHTML;
        },
        getPopupContentHTMLMapV2 : function () {
            
            var popupContentHTML = '<div class="row" style="padding-left: 20px;padding-right: 0px;">';
//            popupContentHTML +='<img src="' + this.getMapNodeIcon() + '">';
            popupContentHTML +='<label class="control-label col-md-12" style="text-align: left;"><h5 style="height: 10px;"><img src="' + IconUtil.getMapNodeIcon() + '"><strong> '+ 'VINA CAFE LONG THANH - BOILER 01' +'</strong>';
            popupContentHTML +='<span class="glyphicon glyphicon-remove pull-right close-icon-popup-map closePopupMap"  style="position: relative;right: -8px;top: -21px;"></span>';
            popupContentHTML +='</h5></label></div>';
            
            popupContentHTML += '<div class="row" style="padding-left: 20px;padding-right: 0px;">';
            popupContentHTML +='<div class="col-md-7" style="text-align: left;">';
            popupContentHTML +='<img src="' + IconUtil.getMapBoilerIcon() + '">  '+'boiler 9';
            popupContentHTML +='</div>';
            popupContentHTML +='<div class="col-md-5" style="text-align: left;">';
            popupContentHTML +='<img src="' + IconUtil.getMapAlarmIcon() + '">  '+'12';
            popupContentHTML +='</div>';
            popupContentHTML +='</div>';
            
            popupContentHTML +='</br>';
            popupContentHTML +='</br>';
            
            popupContentHTML += '<div class="form-horizontal col-md-12" style="padding-left: 0px;padding-right: 0px;">';
            
            // start area 1
            popupContentHTML += '<div class="col-md-3" style="padding-left: 0px;padding-right: 0px;">';
            popupContentHTML += '<div class="col-md-12 popup-sub-area-value" style="padding-left: 0px;padding-right: 0px;background-color: #bdc1c4;">';
            popupContentHTML += '<div class="row col-md-12 span12 pagination-centered" style="text-align: center;margin: 0 auto;">';
            popupContentHTML += 'Steam';
            popupContentHTML += '</div>';
            popupContentHTML += '<div class="row col-md-12 span12 pagination-centered" style="text-align: center;margin: 0 auto;">';
            popupContentHTML += 'total';
            popupContentHTML += '</div>';
            popupContentHTML += '<hr style="margin-top: 2px;margin-bottom: 5px;">';
            popupContentHTML += '<div class="row col-md-12 span12 pagination-centered" style="color: #1bade1;text-align: center;margin: 0 auto;">';
            popupContentHTML += '123456789.45';
            popupContentHTML += '</div>';
            popupContentHTML += '<div class="row col-md-12 span12 pagination-centered" style="text-align: center;margin: 0 auto;">';
            popupContentHTML += 'ton';
            popupContentHTML += '</div>';
            popupContentHTML += '</div>';
            popupContentHTML += '</div>';
            // end area 1
            // start area 2
            popupContentHTML += '<div class="col-md-3" style="padding-left: 5px;padding-right: 0px;">';
            popupContentHTML += '<div class="col-md-12 popup-sub-area-value" style="padding-left: 0px;padding-right: 0px;background-color: #bdc1c4;">';
            popupContentHTML += '<div class="row col-md-12 span12 pagination-centered" style="text-align: center;margin: 0 auto;">';
            popupContentHTML += 'Steam';
            popupContentHTML += '</div>';
            popupContentHTML += '<div class="row col-md-12 span12 pagination-centered" style="text-align: center;margin: 0 auto;">';
            popupContentHTML += 'flow';
            popupContentHTML += '</div>';
            popupContentHTML += '<hr style="margin-top: 2px;margin-bottom: 5px;">';
            popupContentHTML += '<div class="row col-md-12 span12 pagination-centered" style="color: #1bade1;text-align: center;margin: 0 auto;">';
            popupContentHTML += '123456789.98';
            popupContentHTML += '</div>';
            popupContentHTML += '<div class="row col-md-12 span12 pagination-centered" style="text-align: center;margin: 0 auto;">';
            popupContentHTML += 'ton/h';
            popupContentHTML += '</div>';
            popupContentHTML += '</div>';
            popupContentHTML += '</div>';
            // end area 2
            // start area 3
            popupContentHTML += '<div class="col-md-3" style="padding-left: 5px;padding-right: 0px";>';
            popupContentHTML += '<div class="col-md-12 popup-sub-area-value" style="padding-left: 0px;padding-right: 0px;background-color: #bdc1c4;">';
            popupContentHTML += '<div class="row col-md-12 span12 pagination-centered" style="text-align: center;margin: 0 auto;">';
            popupContentHTML += 'Steam';
            popupContentHTML += '</div>';
            popupContentHTML += '<div class="row col-md-12 span12 pagination-centered" style="text-align: center;margin: 0 auto;">';
            popupContentHTML += 'pressure';
            popupContentHTML += '</div>';
            popupContentHTML += '<hr style="margin-top: 2px;margin-bottom: 5px;">';
            popupContentHTML += '<div class="row col-md-12 span12 pagination-centered" style="color: #1bade1;text-align: center;margin: 0 auto;">';
            popupContentHTML += '123456789.89';
            popupContentHTML += '</div>';
            popupContentHTML += '<div class="row col-md-12 span12 pagination-centered" style="text-align: center;margin: 0 auto;">';
            popupContentHTML += 'kg/cm2';
            popupContentHTML += '</div>';
            popupContentHTML += '</div>';
            popupContentHTML += '</div>';
            // end area 3
            // start area 4
            popupContentHTML += '<div class="col-md-3" style="padding-left: 5px;padding-right: 0px;">';
            popupContentHTML += '<div class="col-md-12 popup-sub-area-value" style="padding-left: 0px;padding-right: 0px;background-color: #bdc1c4;">';
            popupContentHTML += '<div class="row col-md-12 span12 pagination-centered" style="text-align: center;margin: 0 auto;">';
            popupContentHTML += 'Steam';
            popupContentHTML += '</div>';
            popupContentHTML += '<div class="row col-md-12 span12 pagination-centered" style="text-align: center;margin: 0 auto;">';
            popupContentHTML += 'temperature';
            popupContentHTML += '</div>';
            popupContentHTML += '<hr style="margin-top: 2px;margin-bottom: 5px;">';
            popupContentHTML += '<div class="row col-md-12 span12 pagination-centered" style="color: #1bade1;text-align: center; margin: 0 auto;">';
            popupContentHTML += '123456789.98';
            popupContentHTML += '</div>';
            popupContentHTML += '<div class="row col-md-12 span12 pagination-centered" style="text-align: center; margin: 0 auto;">';
            popupContentHTML += 'ton';
            popupContentHTML += '</div>';
            popupContentHTML += '</div>';
            popupContentHTML += '</div>';
            // end area 4
            popupContentHTML +='</div>';
            popupContentHTML +='</div>';
            

            return popupContentHTML;
        },
    };
}();

var IconUtil = function() {
    
    return {
        getMapBoilerIcon : function(){
            return 'resources/img/detail boiler-04.png';
        },
        getMapAlarmIcon : function(){
            return 'resources/img/map-04.png';
        },
        getMapNodeIcon : function(){
            return 'resources/img/node.png';
        },
        getMapMarkerIcon : function(){
            return 'resources/img/boiler_33px.png';
        },
        getMapMarkerAlartIcon : function(){
            return 'resources/img/boiler alert.gif';
        },
    };
}();